package com.wu.entity.weixin.requ;


import net.sf.json.JsonConfig;
import net.sf.json.util.PropertyFilter;

public class CustomJsonConfig extends JsonConfig {
    private Class clazz;

    public CustomJsonConfig() {
    }

    public CustomJsonConfig(Class clazz, final String exclude) {
        this.clazz = clazz;
        this.setRootClass(clazz);
        this.setJavaPropertyFilter(new PropertyFilter() {
            public boolean apply(Object arg0, String param, Object arg2) {
                return param.equals(exclude);
            }
        });
    }

    public CustomJsonConfig(Class clazz, final String[] excludes) {
        this.clazz = clazz;
        this.setRootClass(clazz);
        this.setJavaPropertyFilter(new PropertyFilter() {
            public boolean apply(Object arg0, String param, Object arg2) {
                String[] var4 = excludes;
                int var5 = var4.length;

                for(int var6 = 0; var6 < var5; ++var6) {
                    String exclude = var4[var6];
                    if (param.equals(exclude)) {
                        return true;
                    }
                }

                return false;
            }
        });
    }
}

